package br.com.hermes.emu.bt.task;

import br.com.hermes.bt.HmException;
import br.com.hermes.bt.HmHandle;
import br.com.hermes.bt.HmService;
import br.com.hermes.emu.bt.EmuService;


public class EmuServiceTask extends EmuTask {
	
	private HmService hmService;
	
	public EmuServiceTask(HmHandle handle, int what) {
		super(handle, what);
		hmService =  new EmuService();
	}
	
	@Override
	public void run() {
		try {
			if (hmService.start()) {
				System.out.println("Conectado");
				dispatchMessage(hmService.getHmStream());
			}
		} catch (HmException e) {

			System.out.println("ERROR " + e.getMessage());
		}
	}
	
	
}
